<?php
if (!defined('APP_PATH'))
{
    die('Hacking attempt');
}
function smarty_insert_scripts($args)
	{
		static $scripts = array();
		$arr = explode(',', str_replace(' ','',$args['files']));
		$str = '';
		foreach ($arr AS $val)
			{
				if (in_array($val, $scripts) == false)
				{
					$scripts[] = $val;
					 if ($val{0} == '.')
					{
						$str .= '<script type="text/javascript" src="' . $val . '"></script>';
					}
					else
					{
						$str .= '<script type="text/javascript" src="js/' . $val . '"></script>';
					}
				}
			}
    return $str;
}
/*function smarty_insert_styles($args)
	{
		static $styles = array();
		$arr = explode(',', str_replace(' ','',$args['files']));
		$str = '';
		foreach ($arr AS $val)
			{
				if (in_array($val, $styles) == false)
				{
					$styles[] = $val;
					 if ($val{0} == '.')
					{
						$str .= '<link rel="stylesheet" media="screen,projection" type="text/css" href="' . $val . '"/>';
					}
					else
					{
						$str .= '<link rel="stylesheet" media="screen,projection" type="text/css" href="css/' . $val . '"/>';
					}
				}
			}
    return $str;
}
*/